package demo.Polymorphism01;

public class Test {
    public static void main(String[] args) {
        Student s = new Student();
        s.setName("John");
        s.setAge(20);
        Teacher t = new Teacher();
        t.setName("Mary");
        t.setAge(30);
        Administrator a = new Administrator();
        a.setName("Tom");
        a.setAge(40);

        register(s);
        register(t);
        register(a);

    }

    public static void register(Person p) {
        p.show();
    }
}
